package cn.wolfcode.wolf2w.web.controller;


import cn.wolfcode.wolf2w.annotation.UserParam;
import cn.wolfcode.wolf2w.domain.Owner;
import cn.wolfcode.wolf2w.domain.UserInfo;
import cn.wolfcode.wolf2w.service.IOwnerService;
import cn.wolfcode.wolf2w.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@RestController // Requestbody + controller
@RequestMapping("/users")
public class OwnerController {

    @Autowired
    private IOwnerService ownerSerivce;//用jar包,相当于是同个项目了.可以用ownerSerivce



    private String smsAppkey;
//累计访问数
    @GetMapping("/countNum")
    public Object countNum(String id, @UserParam UserInfo userInfo){

        int countNum = ownerSerivce.countNum(id, userInfo.getId());

        return  JsonResult.success( countNum);
    }




}
